<template>
  <div>
    <el-aside width="200px" style="background-color: #D6EAE8">
      <el-menu :router='true'>
        <el-submenu index="1">
          <div slot="title"><i class="el-icon-menu"></i>设备信息</div>
          <el-menu-item index="taiqu">台区</el-menu-item>
          <!-- <el-menu-item index="Statistics">数据统计</el-menu-item> -->
          <!-- <el-menu-item index="Machine">换向器</el-menu-item> -->
        </el-submenu>
        <el-submenu index="2" v-if='userRole!=2'>
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>系统管理</span>
          </template>
          <el-menu-item index="user">用户列表</el-menu-item>
          <el-menu-item index="logs" v-if="userRole==0">日志</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
  </div>
</template>
<script>
import utils from '../ttJs/utils.js'
import { validateData } from '../ttJs/utils.js'

export default {
  name: '',
  data() {
    return {
      currentIndex: '',
      checkedPositions: [],
      isCollapse: false,
      userRole: 2
    };
  },
  components: {},
  mounted: function() {
    this.currentIndex = this.$route.name
    this.userRole = sessionStorage.getItem('role')
  },
  methods: {
    logout() {
      var self = this;
      var url = '/xhc/admin/logout';
      var params = {};
      var success = function(response) {
        self.$router.push({ name: 'Login' })
      }
      var fail = function(res) {}
      var complete = function(res) {}
      utils.request(url, params, success, fail, complete)
    }
  }
}

</script>
<style scoped rel="stylesheet/scss" lang="scss">


</style>
